home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 37 / CD Expert nº 37.iso / LastCall / lastcall.exe / stuff / lastcall.dxr / 00026_Various scripts.ls < prev    next >
Encoding:
Text File  |  2000-03-27  |  21.3 KB  |  788 lines

  1. on stopMovie
  2.   cleanup()
  3.   resetCursor()
  4.   storePrefs()
  5. end
  6.  
  7. on replaceWellItem
  8.   global gWellSprite
  9.   sendSprite(gWellSprite, #mDropIt)
  10. end
  11.  
  12. on replaceActiveBottle
  13.   global gDraggingBottle, gLastIngredient, gSpoonSprite, gSoundFXchan, gMixingVesselsList
  14.   gLastIngredient = 0
  15.   if inBonusMode() then
  16.     playBonusSound(gSoundFXchan, "BRA_X04")
  17.   end if
  18.   sendSprite(gDraggingBottle, #mReplaceIt)
  19.   sendSprite(gSpoonSprite, #mReplaceIt)
  20.   repeat with X in gMixingVesselsList
  21.     sendSprite(X, #mReplaceTop)
  22.   end repeat
  23. end
  24.  
  25. on rememberActiveBottle
  26.   global gRememberIngredient, gRememberSprite, gDraggingBottle, gWellSprite, gSpoonSprite
  27.   if draggingBottleThang() then
  28.     gRememberIngredient = sprite(gDraggingBottle).pIngredient
  29.     gRememberSprite = sprite(gDraggingBottle).pOrigSprite
  30.     sprite(gDraggingBottle).visible = 0
  31.   else
  32.     if draggingSpoon() then
  33.       gRememberIngredient = #spoon
  34.       gSpoonSprite.visible = 0
  35.       gRememberSprite = gSpoonSprite
  36.     else
  37.       if draggingWellThang() then
  38.         gRememberIngredient = gWellSprite.pIngredient
  39.         gWellSprite.visible = 0
  40.         gRememberSprite = gWellSprite
  41.       else
  42.         gRememberIngredient = VOID
  43.         gRememberSprite = sprite(1)
  44.       end if
  45.     end if
  46.   end if
  47.   resetCursor()
  48. end
  49.  
  50. on restoreActiveBottle
  51.   global gRememberIngredient, gRememberSprite, gDraggingBottle, gSpoonSprite, gWellSprite
  52.   gSpoonSprite.visible = 1
  53.   if voidp(gRememberIngredient) or not (draggingBottleOrSpoon() or (gWellSprite.memberNum <> 0)) then
  54.     resetCursor()
  55.     exit
  56.   else
  57.     if gRememberIngredient = #spoon then
  58.       gSpoonSprite.visible = 1
  59.       hideCursor()
  60.     else
  61.       if draggingBottleThang() then
  62.         sprite(gDraggingBottle).visible = 1
  63.         hideCursor()
  64.       else
  65.         if gRememberSprite = gWellSprite then
  66.           gWellSprite.visible = 1
  67.           hideCursor()
  68.         else
  69.           if objectp(gRememberSprite) then
  70.             gRememberSprite.visible = 1
  71.             resetCursor()
  72.           end if
  73.         end if
  74.       end if
  75.     end if
  76.   end if
  77. end
  78.  
  79. on onActorList thisActor
  80.   return getOne(the actorList, thisActor)
  81. end
  82.  
  83. on removeFromActorList thisActor
  84.   findAt = onActorList(thisActor)
  85.   if findAt then
  86.     deleteAt(the actorList, findAt)
  87.   end if
  88. end
  89.  
  90. on addToActorList thisActor
  91.   if inMenuMode() then
  92.     exit
  93.   end if
  94.   findAt = onActorList(thisActor)
  95.   if not findAt then
  96.     add(the actorList, thisActor)
  97.   end if
  98. end
  99.  
  100. on findBigScripts maxK
  101.   if voidp(maxK) then
  102.     maxK = 10
  103.   end if
  104.   repeat with X = 1 to the number of castLibs
  105.     repeat with Y = 1 to the number of castMembers
  106.       if member(Y, X).type = #script then
  107.         len = length(member(Y, X).scriptText)
  108.         if len > (1024 * maxK) then
  109.           put member(Y, X) && member(Y, X).name && len
  110.         end if
  111.       end if
  112.     end repeat
  113.   end repeat
  114.   put "done"
  115. end
  116.  
  117. on findBigLists
  118.   global gRecipes, gIngredients, gCharacterActions, gGlassware, gFlashRects, gImplementedCharacters, gMouthList
  119.   put "gRecipes" && length(string(gRecipes))
  120.   put "gIngredients" && length(string(gIngredients))
  121.   put "gCharacterActions" && length(string(gCharacterActions))
  122.   put "gGlassware" && length(string(gGlassware))
  123.   put "gFlashRects" && length(string(gFlashRects))
  124.   put "gImplementedCharacters" && length(string(gImplementedCharacters))
  125.   put "gMouthList" && length(string(gMouthList))
  126. end
  127.  
  128. on getParentScripts
  129.   repeat with X = 1 to the number of castLibs
  130.     repeat with Y = 1 to the number of castMembers
  131.       if member(Y, X).type = #script then
  132.         if member(Y, X).scriptType = #parent then
  133.           put "Parent script" && member(Y, X)
  134.         end if
  135.       end if
  136.     end repeat
  137.   end repeat
  138. end
  139.  
  140. on findLinked
  141.   repeat with X = 1 to the number of castLibs
  142.     repeat with Y = 1 to the number of castMembers
  143.       if (member(Y, X).fileName <> EMPTY) and (member(Y, X).type <> #flash) and (member(Y, X).type <> #sound) then
  144.         put "Linked" && member(Y, X).type && member(Y, X).name && member(Y, X) && member(Y, X).fileName
  145.       end if
  146.     end repeat
  147.   end repeat
  148. end
  149.  
  150. on currentChar
  151.   Active = getActiveCharacter()
  152.   if Active then
  153.     return sprite(Active).pCharCode
  154.   else
  155.     return VOID
  156.   end if
  157. end
  158.  
  159. on getCharActions charCode
  160.   global gCharacterActions
  161.   return gCharacterActions[charCode]
  162. end
  163.  
  164. on currentActions
  165.   if not voidp(currentChar()) then
  166.     return getCharActions(currentChar())
  167.   else
  168.     return [:]
  169.   end if
  170. end
  171.  
  172. on currentActionSteps
  173.   global gCurrentIndex
  174.   if count(currentActions()) then
  175.     return currentActions()[gCurrentIndex][1]
  176.   else
  177.     return [:]
  178.   end if
  179. end
  180.  
  181. on currentActionName
  182.   global gCurrentIndex
  183.   if count(currentActions()) then
  184.     return getPropAt(currentActions(), gCurrentIndex)
  185.   else
  186.     return "No Active Character"
  187.   end if
  188. end
  189.  
  190. on placeGlassOnBar dragSprite
  191.   global gCharacterSprites, gBarTopManager, gBarSurface
  192.   gBarSurface = 7
  193.   repeat with X in gCharacterSprites
  194.     if sprite(X).member.type <> #flash then
  195.       exit
  196.     end if
  197.     if hitTest(sprite(X), the clickLoc) = #normal then
  198.       barSlot = SpriteToBarSlot(X)
  199.       if barSpotIsFree(gBarTopManager, barSlot) then
  200.         next repeat
  201.       end if
  202.       status = sprite(barSlotToSprite(barSlot)).pStatus
  203.       if getBarTopGlass(gBarTopManager, barSlot) = #none then
  204.         return [#closest: barSlot, #open: 1, #empty: 1, #status: status]
  205.         next repeat
  206.       end if
  207.       if X = barSlotToSprite(barSlot) then
  208.         if mIsEmpty(barSlotToGlassSprite(gBarTopManager, barSlot)) then
  209.           return [#closest: barSlot, #open: 0, #empty: 1, #status: status]
  210.         else
  211.           carded = sprite(barSlotToSprite(barSlot)).pAlreadyCarded
  212.           return [#closest: barSlot, #open: 0, #empty: 0, #status: status, #carded: carded]
  213.         end if
  214.         next repeat
  215.       end if
  216.       alertBeep()
  217.       return [#closest: barSlot, #open: 0, #empty: 1]
  218.     end if
  219.   end repeat
  220.   locH = dragSprite.locH
  221.   barSlot = getClosestOpenSpot(gBarTopManager, locH)[#closest]
  222.   if sprite dragSprite intersects gBarSurface or ((dragSprite.bottom < sprite(gBarSurface).bottom) and (dragSprite.bottom > (sprite(gBarSurface).top - 10))) then
  223.     if getBarTopGlass(gBarTopManager, barSlot) = #none then
  224.       return [#closest: barSlot, #open: 1, #empty: 1]
  225.     else
  226.       if mIsEmpty(barSlotToGlassSprite(gBarTopManager, barSlot)) then
  227.         return [#closest: barSlot, #open: 0, #empty: 1]
  228.       else
  229.         alertBeep()
  230.         return [#closest: barSlot, #open: 0, #empty: 0]
  231.       end if
  232.     end if
  233.   else
  234.     alertBeep()
  235.     return [#closest: 0, #open: 0, #empty: 1]
  236.   end if
  237. end
  238.  
  239. on idle
  240.   global gSoundTrack, gMusicChan
  241.   if voidp(gSoundTrack) then
  242.     stopMusic()
  243.   else
  244.     if soundBusy(gMusicChan) then
  245.     else
  246.       if audibleChannel(gMusicChan) then
  247.         playTrack()
  248.       end if
  249.     end if
  250.   end if
  251. end
  252.  
  253. on prepareMovie
  254.   global debug, gCharPlayList, gFileSep, gBonusPath, gManagerPath, gNoChaos, gHelpPointer, gObeyHelpPointerstate, gFloatSprite, gWellSprite, gToolTip, gDrinkContentSpr, gPourableItemsList, gBarGlassSprites, gPointerSprite, gBarTopSprite, gCharacterSprites, gQuality, gMixingVesselsList, gXbottlePopup, gSodaGunPopup, gSodaGun, gSodaText, gJukeHilight, gDoneFlash, gFastPlay, gDragRect, gSpoonSprite, gBonusCharacters, gOldRecipes, gOldIngredients, gOldCharActions, gOldCharInfo, gOldUserTips, gOldFlashRects, gOldGlassware, gOldGameLevels, gThrottleRate, gPourThrottleRate, gEvenPouring, gShowFlashRects, gRatingBoard, gEasyHeaven, gIceSounds, gReportDrink, gIceSprite, gArbusSprite, gSoundDevice, gQuickPlayMode, gMachineSpeed, gOldSoundLevel, gJukeMuteButton, gJukeVolumeSlider, gClickToIDorOrder, gIDbutton, gOrderButton, gServeButton, gEmptyButton, gGlassAndBeerList, gGlassList, gVesselList, gLemonLimeList, gCarbonatedList, gExcludeBonusList, gStartRegisterSpr, gEndRegisterSpr, gDecimalPoint, gMaxTips, gPearlyGates, gSoundExtension, gDemoVersion
  255.   set the floatPrecision to 2
  256.   if onPC() then
  257.     if voidp(gSoundDevice) then
  258.       if the soundDevice = "MacroMix" then
  259.         the soundDevice = "QT3Mix"
  260.       end if
  261.     end if
  262.   end if
  263.   set the exitLock to 1
  264.   setVis(1)
  265.   oldClickToIDorOrder = gClickToIDorOrder
  266.   oldQuickPlayMode = gQuickPlayMode
  267.   oldMachineSpeed = gMachineSpeed
  268.   oldRatingBoard = gRatingBoard
  269.   oldDebug = debug
  270.   oldChaos = gNoChaos
  271.   oldQuality = gQuality
  272.   oldFlash = gDoneFlash
  273.   oldFastPlay = gFastPlay
  274.   oldThrottle = gThrottleRate
  275.   oldPourRate = gPourThrottleRate
  276.   oldEvenPour = gEvenPouring
  277.   oldShowFlashRects = gShowFlashRects
  278.   oldRecipes = gOldRecipes
  279.   oldngredients = gOldIngredients
  280.   oldUserTips = gOldUserTips
  281.   oldCharActions = gOldCharActions
  282.   oldCharInfo = gOldCharInfo
  283.   oldFlashRects = gOldFlashRects
  284.   oldGlassware = gOldGlassware
  285.   oldGameLevels = gOldGameLevels
  286.   oldEasyHeaven = gEasyHeaven
  287.   oldIceSounds = gIceSounds
  288.   oldReportDrink = gReportDrink
  289.   if (authoring() or debug) and voidp(gCharPlayList) then
  290.   end if
  291.   oldPlayList = gCharPlayList
  292.   if authoring() then
  293.     if not gPearlyGates then
  294.     end if
  295.     if the moviePath = "Zach Mac:Clients:bartend/Cutler:Cutler working:" then
  296.       setbruce()
  297.     end if
  298.   end if
  299.   gDemoVersion = 1
  300.   if gDemoVersion then
  301.     gSoundExtension = ".swa"
  302.   else
  303.     gSoundExtension = ".aif"
  304.   end if
  305.   gMaxTips = 100000
  306.   gGlassAndBeerList = [#hiball, #shot, #collins, #old_fashioned, #cocktail, #beer]
  307.   gGlassList = [#hiball, #shot, #collins, #old_fashioned, #cocktail]
  308.   gVesselList = [#mixingGlass, #blender, #shaker]
  309.   gLemonLimeList = [#lemonWedge, #limeWedge, #lemontwist, #limetwist]
  310.   gCarbonatedList = [#cola, #gingerAle, #lemonLime, #Soda, #tonic]
  311.   gExcludeBonusList = [#lemontwist, #limetwist, #lemon, #lime]
  312.   gStartRegisterSpr = 100
  313.   gDecimalPoint = 103
  314.   gEndRegisterSpr = 105
  315.   gBarGlassSprites = [79, 83, 87]
  316.   gMixingVesselsList = [49, 51, 53]
  317.   startMainBarMode(#game)
  318.   gCharacterSprites = [9, 13, 17]
  319.   gBonusCharacters = [9, 11, 13]
  320.   gBarTopSprite = sprite(7)
  321.   gArbusSprite = sprite(23)
  322.   gSodaGun = sprite(40)
  323.   gIceSprite = sprite(42)
  324.   gSpoonSprite = sprite(55)
  325.   gIDbutton = sprite(92)
  326.   gOrderButton = sprite(98)
  327.   gServeButton = sprite(99)
  328.   gEmptyButton = sprite(107)
  329.   gPointerSprite = sprite(110)
  330.   gFloatSprite = sprite(111)
  331.   gWellSprite = sprite(113)
  332.   gToolTip = sprite(114)
  333.   gDrinkContentSpr = sprite(117)
  334.   gJukeMuteButton = sprite(121)
  335.   gJukeVolumeSlider = sprite(124)
  336.   gJukeHilight = sprite(125)
  337.   gSodaText = sprite(129)
  338.   gXbottlePopup = sprite(142)
  339.   gDragRect = sprite(147)
  340.   gSodaGunPopup = sprite(143)
  341.   gOldRecipes = oldRecipes
  342.   gOldIngredients = oldngredients
  343.   gOldUserTips = oldUserTips
  344.   gOldCharActions = oldCharActions
  345.   gOldCharInfo = oldCharInfo
  346.   gOldFlashRects = oldFlashRects
  347.   gOldGlassware = oldGlassware
  348.   gOldGameLevels = oldGameLevels
  349.   gThrottleRate = oldThrottle
  350.   gPourThrottleRate = oldPourRate
  351.   gEvenPouring = oldEvenPour
  352.   gShowFlashRects = oldShowFlashRects
  353.   gRatingBoard = oldRatingBoard
  354.   gQuickPlayMode = oldQuickPlayMode
  355.   gMachineSpeed = oldMachineSpeed
  356.   gClickToIDorOrder = oldClickToIDorOrder
  357.   if not integer(gThrottleRate) then
  358.     gThrottleRate = 5
  359.   end if
  360.   gThrottleRate = max(1, gThrottleRate)
  361.   if not integerp(gPourThrottleRate) then
  362.     gPourThrottleRate = 5
  363.   end if
  364.   gPourThrottleRate = max(1, gPourThrottleRate)
  365.   gEvenPouring = 1
  366.   gOldSoundLevel = rememberOriginalVolume()
  367.   setDefaults()
  368.   setOptionDefaults()
  369.   debug = oldDebug
  370.   gNoChaos = oldChaos
  371.   gQuality = oldQuality
  372.   gDoneFlash = oldFlash
  373.   gCharPlayList = oldPlayList
  374.   gFastPlay = oldFastPlay
  375.   gEasyHeaven = oldEasyHeaven
  376.   gIceSounds = oldIceSounds
  377.   gReportDrink = oldReportDrink
  378.   setUpPrefsFolder()
  379.   readPrefs()
  380.   gBonusPath = basePath() & "BONUSVO" & gFileSep
  381.   gManagerPath = basePath() & "HP_VO" & gFileSep & "HPD_"
  382.   if voidp(gQuality) then
  383.     gQuality = #low
  384.   end if
  385.   if ilk(gQuality) <> #symbol then
  386.     gQuality = symbol(gQuality)
  387.   end if
  388.   initCharInfo()
  389.   initCharActions()
  390.   InitCharacterMouths()
  391.   initRecipes()
  392.   initIngredients()
  393.   initUserTips()
  394.   correctUserTips()
  395.   initGlassware()
  396.   initFlashRects()
  397.   menuMode(1)
  398. end
  399.  
  400. on setGameSchedule fast
  401.   global gGameSetup
  402.   initGameLevels()
  403.   repeat with thisLevel in gGameSetup
  404.     if fast then
  405.       thisLevel[#MINTIPS] = thisLevel[#MINTIPS] / 5
  406.       thisLevel[#duration] = thisLevel[#duration] / 4
  407.       thisLevel[#MAXEARLYTIPS] = thisLevel[#MAXEARLYTIPS] / 5
  408.     end if
  409.   end repeat
  410. end
  411.  
  412. on setOptionDefaults
  413.   global gHelpPointer, gTwistTips, gGameTips, gSodaTips, gXbottleTips, gMuteAllSounds, gObeyHelpPointerstate, gMusicChan, gOldSoundLevel, gMuted
  414.   defaultVolume = 255
  415.   repeat with chan = 1 to 8
  416.     set the volume of sound chan to fixVolume(defaultVolume)
  417.   end repeat
  418.   set the volume of sound gMusicChan to fixVolume(defaultVolume * 0.59999999999999998)
  419.   restoreOriginalVolume(gOldSoundLevel)
  420.   gHelpPointer = 1
  421.   gObeyHelpPointerstate = 1
  422.   gUseManagerVO = 1
  423.   gGameTips = 1
  424.   gSodaTips = 1
  425.   gTwistTips = 1
  426.   gXbottleTips = 1
  427.   resetXbottleFlags()
  428.   resetSodaFlags()
  429.   gMuteAllSounds = 0
  430.   gMuted = 0
  431. end
  432.  
  433. on readCharacterDatabase charCode
  434.   global gTable
  435.   charData = [:]
  436.   mSetCriteria(gTable, "character_code", "=", string(charCode))
  437.   mOrderBy(gTable, "action_names")
  438.   mSelect(gTable)
  439.   numRecs = mSelectCount(gTable)
  440.   mGoFirst(gTable)
  441.   repeat with n = 1 to numRecs
  442.     action = symbol(mGetField(gTable, "action_names"))
  443.     steps = value(mGetField(gTable, "List"))
  444.     weight = integer(mGetField(gTable, "weighting"))
  445.     addProp(charData, action, [steps, weight])
  446.     mGoNext(gTable)
  447.   end repeat
  448.   return charData
  449. end
  450.  
  451. on newCharacterEnters setAsActive, newChar, openSeat
  452.   global gBarTopManager, gCharPlayList, gBounceInProgress, gPauseState, gImplementedCharacters, gCharacterSprites, gMachineSpeed, debug, gPearlyGates, gUserQuitFlag
  453.   afterHours = 0
  454.   if gUserQuitFlag then
  455.     return 0
  456.   end if
  457.   if gPearlyGates then
  458.     if newChar = #BC then
  459.       afterHours = 1
  460.     else
  461.       return 0
  462.     end if
  463.   end if
  464.   if not afterHours then
  465.     if beyondMaxTips() or (timeLeftOnThisLevel() <= 0) then
  466.       return 0
  467.     end if
  468.     if gBounceInProgress or gPauseState or inMenuMode() then
  469.       if not inTestMode() then
  470.         return 0
  471.       end if
  472.     end if
  473.     if gMachineSpeed <> #fast then
  474.       repeat with X in gCharacterSprites
  475.         if sendSprite(X, #deferAction) then
  476.           if debug then
  477.             put "Deferred approaching patron on slow machine because others were animating"
  478.           end if
  479.           return 0
  480.         end if
  481.       end repeat
  482.     end if
  483.     if voidp(setAsActive) and (numberAtBar(gBarTopManager) > 0) then
  484.       return 0
  485.     end if
  486.     if inRecipeMode() then
  487.       if numberAtBar(gBarTopManager) > 0 then
  488.         return 0
  489.       end if
  490.       openSeat = 2
  491.     end if
  492.     if maxAtBar(gBarTopManager) and not inTestMode() then
  493.       return 0
  494.     end if
  495.   end if
  496.   resetNewCharacterTimer()
  497.   if findNExtOccupiedSlot(gBarTopManager) = 0 then
  498.     setAsActive = #Always
  499.   end if
  500.   if listp(gCharPlayList) and not inTestMode() then
  501.     newChar = gCharPlayList[1][#char]
  502.     if not inRecipeMode() then
  503.       openSeat = gCharPlayList[1][#pos]
  504.     end if
  505.     deleteAt(gCharPlayList, 1)
  506.     if count(gCharPlayList) = 0 then
  507.       gCharPlayList = VOID
  508.     end if
  509.     setCustomPositionInfo(openSeat, newChar)
  510.   else
  511.     if voidp(openSeat) then
  512.       openSeat = getOpenBarSeat(gBarTopManager)
  513.     end if
  514.     if inTestMode() and (openSeat <> 0) and not voidp(newChar) then
  515.       setCustomPositionInfo(openSeat, newChar)
  516.     end if
  517.     if voidp(newChar) and (openSeat <> 0) then
  518.       newChar = getRandomCharacter(gBarTopManager, openSeat)
  519.       if voidp(newChar) then
  520.         if numberAtBar(gBarTopManager) = 0 then
  521.           newChar = randomFromList([#JS, #KY, #LG, #EM, #TF, #AT, #RN, #XF, #LN])
  522.           put "We're really desperate and something is very wrong. Let's bring on anyone"
  523.           &&(newChar)
  524.         else
  525.           put "No character brought on due to excessive conflicts"
  526.           return 0
  527.         end if
  528.       end if
  529.     end if
  530.   end if
  531.   if openSeat = 0 then
  532.     put "No more room at the bar"
  533.     return 0
  534.   else
  535.     if voidp(newChar) then
  536.       debugAlert("There should never be a void character added" && openSeat)
  537.       return 0
  538.     end if
  539.     setBarTopCharacter(gBarTopManager, openSeat, newChar)
  540.     sendSprite(sprite(barSlotToSprite(openSeat)), #approach, newChar)
  541.     case setAsActive of
  542.       #Always, 1:
  543.         setAsActive = 1
  544.       #ifServed:
  545.         patronWithFocus = getActiveCharacter()
  546.         if patronWithFocus = 0 then
  547.           setAsActive = 1
  548.         else
  549.           if sendSprite(patronWithFocus, #statusIs, [#offStage, #served, #retreating, #bouncing]) then
  550.             setAsActive = 1
  551.           else
  552.             setAsActive = 0
  553.           end if
  554.         end if
  555.       VOID:
  556.         setAsActive = 0
  557.       otherwise:
  558.         setAsActive = 0
  559.     end case
  560.   end if
  561.   if setAsActive then
  562.     makePatronActive(openSeat)
  563.   end if
  564.   return 1
  565. end
  566.  
  567. on setCustomPositionInfo openSeat, newChar
  568.   global gImplementedCharacters, gBarTopManager
  569.   case openSeat of
  570.     1:
  571.       customPosCheck = #P1A
  572.     2:
  573.       customPosCheck = #P2A
  574.     3:
  575.       customPosCheck = #P3A
  576.   end case
  577.   chosenCharInfo = gImplementedCharacters[newChar]
  578.   if chosenCharInfo[customPosCheck] = 1 then
  579.     posOffset = 0
  580.   else
  581.     posOffset = chosenCharInfo[customPosCheck]
  582.   end if
  583.   setBarPositionOffset(gBarTopManager, openSeat, posOffset)
  584. end
  585.  
  586. on flashMember charCode
  587.   X = member(charCode & ".SWF")
  588.   return X
  589. end
  590.  
  591. on flashMouthMember charCode
  592.   X = member(charCode & "_mouth")
  593.   return X
  594. end
  595.  
  596. on relinkExtraCast charCode
  597.   charString = string(charCode)
  598.   castLib("extrachr").fileName = setCharPath(charCode) & charString & "_extra.cst"
  599. end
  600.  
  601. on setbruce
  602.   global gBrucePath
  603.   gBrucePath = "BetaBuild10:stuff:"
  604. end
  605.  
  606. on resetCharDatabase
  607.   resetCharInfo()
  608.   resetCharActions()
  609.   resetFlashRects()
  610. end
  611.  
  612. on resetRecipeDatabase
  613.   resetUserTips()
  614.   resetGlassware()
  615.   resetIngredients()
  616.   resetRecipes()
  617. end
  618.  
  619. on resetCharInfo
  620.   global gOldCharInfo
  621.   gOldCharInfo = 0
  622.   initCharInfo()
  623.   cleanupcharInfo()
  624.   put "CharInfo" && count(getOldCharInfoDB())
  625. end
  626.  
  627. on resetCharActions
  628.   global gOldCharActions, gImplementedCharacters
  629.   if count(gImplementedCharacters) < 1 then
  630.     resetCharInfo()
  631.   end if
  632.   gOldCharActions = 0
  633.   initCharActions()
  634.   cleanupCharActions()
  635.   put "CharActions" && count(getOldCharActionsDB())
  636. end
  637.  
  638. on resetFlashRects
  639.   global gOldFlashRects
  640.   gOldFlashRects = 0
  641.   initFlashRects()
  642.   cleanupFlashRects()
  643.   put "FlashRects" && count(getOldFlashRectsDB())
  644. end
  645.  
  646. on resetIngredients
  647.   global gOldIngredients
  648.   member("ingredientDB").scriptText = EMPTY
  649.   alert("Don't forget to replace '<void>' with 'void' in the ingredientDB script")
  650.   gOldIngredients = 0
  651.   initIngredients()
  652.   cleanupIngredients()
  653.   put "Ingredients" && count(getOldIngredientsDB())
  654. end
  655.  
  656. on resetUserTips
  657.   global gOldUserTips
  658.   gOldUserTips = 0
  659.   initUserTips()
  660.   cleanupUserTips()
  661.   put "UserTips" && count(getOldUserTipsDB())
  662. end
  663.  
  664. on resetRecipes
  665.   global gOldRecipes
  666.   gOldRecipes = 0
  667.   initRecipes()
  668.   put "Done importing. Now we still need to store them..."
  669.   cleanUpRecipes()
  670.   put "Recipes" && count(getOldRecipesDB())
  671. end
  672.  
  673. on resetGlassware
  674.   global gOldGlassware
  675.   gOldGlassware = 0
  676.   initGlassware()
  677.   cleanupGlassware()
  678.   put "Glassware" && count(getOldGlasswareDB())
  679. end
  680.  
  681. on resetgamelevels
  682.   global gOldGameLevels
  683.   gOldGameLevels = 0
  684.   initGameLevels()
  685.   cleanupGameLevels()
  686.   put "GameLevels" && count(getOldGameLevelsDB())
  687. end
  688.  
  689. on basePath
  690.   global gBrucePath
  691.   if voidp(gBrucePath) then
  692.     return the moviePath
  693.   else
  694.     return gBrucePath
  695.   end if
  696. end
  697.  
  698. on setVOPath charCode
  699.   global gFileSep, gCharInfo
  700.   charString = string(charCode)
  701.   voBaseLoc = setCharPath(charCode) & "VO" & gFileSep & charString
  702.   return voBaseLoc
  703. end
  704.  
  705. on setCharPath charCode
  706.   global gFileSep
  707.   charString = string(charCode)
  708.   voBaseLoc = basePath() & "Chars" & gFileSep & charString & gFileSep
  709.   return voBaseLoc
  710. end
  711.  
  712. on VOpath charCode, VOname
  713.   global gCharChildren, gSoundExtension
  714.   voLoc = gCharChildren[charCode].pVOpath & "D_" & VOname & gSoundExtension
  715.   return voLoc
  716. end
  717.  
  718. on gotoRoundSummary
  719.   beginPause()
  720.   menuMode(1)
  721.   dismissAllCrap()
  722.   go("Summary")
  723. end
  724.  
  725. on gotoBonusRound
  726.   beginPause()
  727.   menuMode(1)
  728.   dismissAllCrap(0)
  729.   returnToBar(#bonus)
  730. end
  731.  
  732. on playBonusSoundDrop
  733.   global gSoundFXchan
  734.   playBonusSound(gSoundFXchan, "BRA_X05")
  735. end
  736.  
  737. on dropWellItemInBonusRound pIngredient
  738.   global gWellSprite
  739.   garnishableList = [9, 11, 13, gWellSprite]
  740.   repeat with X in garnishableList
  741.     if not voidp(mapStageToMember(sprite(X), the clickLoc)) then
  742.       playBonusSoundDrop()
  743.       return sendSprite(X, #mDropIngredient, pIngredient)
  744.     end if
  745.   end repeat
  746.   return 0
  747. end
  748.  
  749. on playBonusSound chan, soundName
  750.   global gBonusPath, gSoundExtension
  751.   if not audibleChannel(chan) then
  752.     exit
  753.   end if
  754.   if voidp(soundName) or (chan < 1) then
  755.     debugAlert("Bad bonus sound FX" && chan && soundName)
  756.     exit
  757.   end if
  758.   if the number of member soundName > 0 then
  759.     puppetSound(chan, soundName)
  760.   else
  761.     soundPlayfile(chan, gBonusPath & soundName & gSoundExtension)
  762.   end if
  763. end
  764.  
  765. on startMovie
  766.   global gStageCorner, gCurrentSong, gBarTopManager, gDoneFlash, gGameLevel, gPlayerTips, gNameChosen, gSecretBottles
  767.   bringAppToFront()
  768.   if FileExists(gSecretBottles) and not authoring() then
  769.     castLib("bottles_main").fileName = gSecretBottles
  770.   end if
  771.   the netThrottleTicks = 2000
  772.   the actorList = []
  773.   set the mouseDownScript to "resetFocusMouseDown"
  774.   set the mouseUpScript to "resetFocusMouseUp"
  775.   checkInstallation("MUI")
  776.   retrieveHiScores()
  777.   the randomSeed = the ticks
  778.   setLevelCurrentSong()
  779.   gNameChosen = 0
  780.   playTrack()
  781.   resetNewCharacterTimer()
  782.   setWindowDefaults()
  783.   forgetAllWindows()
  784.   setWindowDefaults()
  785.   gStageCorner = point((the stage).rect.left, (the stage).rect.top)
  786.   gGameLevel = 0
  787. end
  788.